//
//  UserFactory.m
//  used
//
//  Created by lanou on 16/7/26.
//  Copyright © 2016年 王凯. All rights reserved.
//

#import "UserFactory.h"
#import "CDUserModel.h"



@interface CDUser : NSObject <CDUserModelDelegate>

@property (nonatomic, strong) NSString *userId;

@property (nonatomic, strong) NSString *username;

@property (nonatomic, strong) NSString *avatarUrl;

@end

@implementation CDUser

@end

@implementation UserFactory

- (void)cacheUserByIds:(NSSet *)userIds block:(AVIMBooleanResultBlock)block {
    block(YES,nil);
}

- (id<CDUserModelDelegate>)getUserById:(NSString *)userId {
    CDUser *user = [[CDUser alloc] init];
    user.userId = userId;
    //在cell 中显示的聊天对象的名字
    user.username = userId;
    
    
    BmobUser *myuser = [BmobUser getCurrentUser];
    if (myuser) {
        
        BmobFile *icon = [myuser objectForKey:@"icon"];
        
        //聊天对象的头像
        user.avatarUrl = icon.url;
    }
  
    return user;
}


@end

